package com.yueke.gemini.utils;

import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;

/**
 * 说明：响应公共类
 * Created by admin on 2017/4/20.
 */
public class ResponseUtil {

    /**
     * 说明：公共的响应数据
     * @param response
     * @param param
     */
    public static void print(HttpServletResponse response, String param){
        try {
            //设置响应编码格式
            response.setCharacterEncoding("utf-8");
            //设置响应体的内容格式
            response.setContentType("text/html; charset=utf-8");

            PrintWriter pw=response.getWriter();
            pw.print(param);
            pw.flush();
            pw.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
